www.gusucode.com > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信 > 基于Matlab的MIMO通信系统仿真 含报告;司中威;了解移动通信关键技术,了解数字通信系统仿真流程,实现基本的信道编译码、调制解调等通信模块。(好评如潮,课设拿满) 学习并实现MIMO空时处理技术 学习性能分析的思路和方法/mimo/matlab for mimo 2x2/Detector.m

    function [rA_data_I, rA_data_Q, rB_data_I, rB_data_Q] = Detector(H_hat_2,rA_data_I, rA_data_Q, rB_data_I, rB_data_Q,type,SNR)
% function [rA_data_I, rA_data_Q, rB_data_I, rB_data_Q] = Detector(H_hat_2,Y,type,SNR)
% S_type = (s1;s2) detected
% rA_data_I, rA_data_Q, rB_data_I, rB_data_Q, the real parts and imag parts
% of s1 and s2 respectively.
% H_hat_2 estimated channel matrix
% Y received vector
% type different criteria
% SNR Signal to Noise Ritio in dB
% 
% By Jinfeng Du
% 05-04-22
ML = 1;
JMMSE = 2;
ZF = 3;

if nargin<3
    type = JMMSE;
end
if nargin<4
    SNR = 20;%in dB
end

if type ~= ML
Y = [rA_data_I + j* rA_data_Q; rB_data_I+ j*rB_data_Q];
end

if type == ML
    [rA_data_I, rA_data_Q, rB_data_I, rB_data_Q] = MLDetector(H_hat_2, rA_data_I, rA_data_Q, rB_data_I, rB_data_Q);
       
elseif type == JMMSE
    % Detect using JMMSE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    G_JMMSE = inv(H_hat_2'*H_hat_2+10^(-SNR/10.0)*eye(2))*H_hat_2';
    S_JMMSE = G_JMMSE * Y;
    rA_data_I = real(S_JMMSE(1,:));
    rA_data_Q = imag(S_JMMSE(1,:));
    rB_data_I = real(S_JMMSE(2,:));
    rB_data_Q = imag(S_JMMSE(2,:));
    
elseif type == ZF
    % Detect using Zero-Forcing%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    G_ZF = inv(H_hat_2'*H_hat_2)*H_hat_2';
    S_ZF = G_ZF * Y;
    rA_data_I = real(S_ZF(1,:));
    rA_data_Q = imag(S_ZF(1,:));
    rB_data_I = real(S_ZF(2,:));
    rB_data_Q = imag(S_ZF(2,:));
end